package vip.specimen.system.datasource.validation.question;

import vip.specimen.system.service.question.ColumnService;

import javax.annotation.Resource;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.UUID;

/**
 * *@Author: 余浪人
 * *@Date：2021/4/28 10:00
 * *@Email:yulangren520@Gmail.com
 * *@QQ:1368419640
 **/
public class QuestionColumnImp implements ConstraintValidator<QuestionColumn, UUID> {
    @Resource
    private ColumnService columnService;

    @Override
    public boolean isValid(UUID uuid, ConstraintValidatorContext constraintValidatorContext) {
        if (null == uuid) return false;
        return null != this.columnService.findById(uuid);
    }
}
